﻿@model PersonalSite.Models.ContactViewModel
@{
    ViewBag.Title = "Contact";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div id="card">
</div>
<div id="wrapperForm">
    <div id="form-div">
        @using (Html.BeginForm())
        { 
            @Html.ValidationSummary(true) 
            <fieldset>
                <legend>Send E-mail</legend>
                <div class="editor-label">
                    @Html.LabelFor(model => model.From)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.From)
                    @Html.ValidationMessageFor(model => model.From, null, new { @class = "annotation" })
                </div>
                <div class="editor-label">
                    @Html.LabelFor(model => model.Subject)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Subject)
                    @Html.ValidationMessageFor(model => model.Subject, null, new { @class = "annotation" })
                </div>
                <div class="editor-label">
                    @Html.LabelFor(model => model.Message)
                </div>
                <div class="editor-field">
                    @Html.TextAreaFor(model => model.Message, new { rows="1"})
                    @Html.ValidationMessageFor(model => model.Message, null, new { @class = "annotation" })
                </div>
                <p class="submit">
                    <input type="submit" value="Send" />
                </p>
            </fieldset> 
        }
    </div>
</div>
<div id="contactSpace">
</div>
@*
@{
    ViewBag.Title = "Contact";
}
<div id= "contact" class= "transition" style="display: none">
    <form method="POST" name="contactform" action="contact-form-handler.php">
    <p>
        <label for='name'>
            Your Name:</label>
        <br>
        <input type="text" name="name">
    </p>
    <p>
        <label for='email'>
            Email Address:</label>
        <br>
        <input type="text" name="email">
        <br>
    </p>
    <p>
        <label for='message'>
            Message:</label>
        <br>
        <textarea name="message"></textarea>
    </p>
    <input type="submit" value="Submit"><br>
    </form>
</div>
<script language="JavaScript">
    // Code for validating the form
    // Visit http://www.javascript-coder.com/html-form/javascript-form-validation.phtml
    // for details
    var frmvalidator = new Validator("contactform");
    frmvalidator.addValidation("name", "req", "Please provide your name");
    frmvalidator.addValidation("email", "req", "Please provide your email");
    frmvalidator.addValidation("email", "email", "Please enter a valid email address"); 
</script>
<div id="contact" class="transition" style="display: none">
    <div id="card">
    </div>
    <div id="wrapperForm">
        <div id="form-div">
            <form class="form" id="form1" method="post" action="ajaxSubmit.php">
            <p class="name">
                <label for="name">
                    Name *</label>
                <input class="form" name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] text-input"
                    id="name" value="My Name" />
            </p>
            <p class="email">
                <label for="email">
                    E-mail*
                </label>
                <input class="form" name="email" type="text" class="validate[required,custom[email]] text-input"
                    id="email" value="email@email.com" />
            </p>
            <p class="text">
                <textarea rows="1" cols="1" name="text" class="validate[required,length[6,500]] text-input"
                    id="comment">Your text here...</textarea>
            </p>
            <p class="submit">
                <input type="submit" value="Send" />
            </p>
            </form>
        </div>
    </div>
    <div id="contactSpace">
    </div>
</div>
*@